package com.activiti.spring;

import java.util.List;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.repository.ProcessDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringActivitiTest {
	public static void main(String[] args) {
		// 创建spring工厂
		ApplicationContext ctx = new ClassPathXmlApplicationContext(
				"com\\itheima\\activiti\\spring\\applicationContext.xml");
		// 从工厂中获得对象
		ProcessEngine processEngine = (ProcessEngine) ctx
				.getBean("processEngine");
		List<ProcessDefinition> list = processEngine.getRepositoryService()
				.createProcessDefinitionQuery().list();
		for (ProcessDefinition processDefinition : list) {
			System.out.println(processDefinition);
		}
	}
}
